<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Spring Boot Thymeleaf + Spring Security</title>

    <div th:replace="/fragments/header :: header-css"/>

</head>
<body>

<div th:replace="/fragments/header :: header"/>

<div class="container">

    <div class="container">

        <div class="row" style="margin-top:20px">
            <div class="col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset-3">
                <form autocomplete="off" action="#" th:action="@{/createComment}"
                      th:object="${comment}" method="post" role="form">

                    <h2 class="text-center">Write new comment</h2>

                    <div class="form-group">
                        <label th:if="${#fields.hasErrors('body')}" th:errors="*{body}"
                               class="alert alert-danger"></label>
                        <textarea th:field="*{body}"
                                  placeholder="Body" class="form-control input-lg"/>
                    </div>

                    <input type="hidden" th:field="*{post}"/>
                    <input type="hidden" th:field="*{user}"/>

                    <div class="form-group">
                        <button type="submit" class="btn btn-primary btn-block">Comment</button>
                    </div>

                </form>
            </div>
        </div>

    </div>

</div>
<!-- /.container -->

<div th:replace="/fragments/footer :: footer"/>

</body>
</html>